#ifndef __GfxDriver_WGL_WGL2DTexture_h__
#define __GfxDriver_WGL_WGL2DTexture_h__

#include "GfxDriver/Texture.h"
#include "GfxDriver/WGL/GLInclude.h"

namespace Orca {

	class GfxDriver;

	//--------------------------------------------------------------------------
	class WGL2DTexture : public Texture2d {

	public:
		static WGL2DTexture* create(
			GfxDriver *gfxDriver,
			uint32 w,
			uint32 h,
			PixelFormat format);

		WGL2DTexture();

		virtual ~WGL2DTexture();

		virtual uint32 getWidth() const;
		virtual uint32 getHeight() const;
		virtual PixelFormat getPixelFormat() const;

		virtual unsigned int getAPIHandle() const;
		virtual unsigned int getAPITexType() const;

		virtual void* requestUpload();
		
		virtual bool uploadToGPU(bool autoGenMipmap);

	private:
		GfxDriver		*mGfxDriver;
		uint32			mW, mH;
		PixelFormat	mFmt;
		uint8	*mData;
		GLuint			mGLHandle;

		bool _init(
			GfxDriver *gfxDriver,
			uint32 w,
			uint32 h,
			PixelFormat format);

	};

}

#endif	// __GfxDriver_WGL_WGL2DTexture_h__